package com.qwz.extend;
/**  
* @Description:
* @Package com.qwz.extend.Client
* @author Qiuwuzhi
* @date 2019/12/25 15:16
* @version V1.0
*/
public class Client {
    public static void main(String[] args) {
        PayStrategy rmbCash = new RmbCash();
        PayStrategy dollarCash = new DollarCash();

        PaymentContent content = new PaymentContent("ls", 1000, rmbCash);
        content.payNow();
        content = new PaymentContent("ws", 2000, dollarCash);
        content.payNow();

        //添加新的支付方式 - 扩展上下文的方式，风格统一
        PayStrategy card = new Card();
        content = new PaymentContent2("xw",3000,card,"2731797");
        content.payNow();
        //添加新的支付方式 - 扩展策略算法，添加自己需要的参数
        PayStrategy card2 = new Card2("678712313");
        content = new PaymentContent("qw", 4000, card2);
        content.payNow();
    }
}
